<!DOCTYPE HTML>
<html>
<head>
    <include file="Common:header_include"/>
    <title>添加栏目</title>
</head>
<body>
<div class="pd-20">
    <form action="{:U('add')}" method="post" class="form form-horizontal" id="form">
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>类型：</label>
            <div class="formControls col-5">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="model_id" datatype="*" nullmsg="请选择">
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <option value="x">顶级类型</option>
                    <volist name=":getList('model')" id="v">
                        <option value="{$v.id}">{$v.title}</option>
                    </volist>
                </select>
                </span>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>父栏目：</label>
            <div class="formControls col-5">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="column_id" datatype="*" nullmsg="请选择">
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <option value="x">顶级栏目</option>
                    <volist name=":getColumnTree()" id="v">
                        <option value="{$v.id}" <if condition="$v['column_id'] neq 0">disabled="disabled"</if>>{$v.title}</option>
                    </volist>
                </select>
                </span>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red">*</span>菜单名：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="title" datatype="*" nullmsg="不能为空">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>描述：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="content">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl" id="link">
            <label class="form-label col-3"><span class="c-red">*</span>链接：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="link">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl" id="english">
            <label class="form-label col-3"><span class="c-red">*</span>英文名：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="english">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl" id="icon">
            <label class="form-label col-3"><span class="c-red"></span>图标代码：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="icon">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl" id="alias">
            <label class="form-label col-3"><span class="c-red"></span>控制器名：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="alias">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-3"><span class="c-red"></span>排序：</label>
            <div class="formControls col-5">
                <input type="text" class="input-text" placeholder="请输入" name="sort">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <div class="col-9 col-offset-3">
                <input class="btn btn-primary radius" type="submit" value="提交">
            </div>
        </div>
    </form>
</div>
<include file="Common:footer_include"/>
<script>
    function selectTopMenu() {
        var selMenuId = $("select[name='column_id']").val();
//        alert(selMenuId);
        var icon = $("#icon");
        var link = $("#link");
        var alias = $("#alias");
        if(selMenuId == 0){
            link.hide();
            icon.show();
            alias.show();
        }else{
            icon.hide();
            alias.hide();
            link.show();
        }
    }
</script>
</body>
</html>